package com.gopay.common.domain.ptbank;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;


import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


/**
 * Entity: 标的账务汇总文件
 */
@Entity
@Table(name = "GSRT_BANK_HF_TD_ACCT_SUM")
public class GsrtBankHfTdAcctSum implements java.io.Serializable {
	
	/**
     * 
     * @Description 上传文本数据项坐标
     * @author zyt
     * @date 2016年05月03日
     *
     */
    public enum UploadCoordinate {
    	PROID(0, "proid", "支付机构标的ID"), 
    	MERCUSTID(1, "mercustid", "支付机构平台ID"),
    	BORRNAME(2, "borrname", "借款人姓名"), 
        BORRCERTTYPE(3, "borrcerttype", "借款人证件类型"),
        BORRCERTID(4, "borrcertid", "借款人证件号码"), 
        CREDITACCTNO(5, "creditacctno", "放款客户号"),
        PROSTAT(6, "prostat", "标的状态"), 
        OJTDATE(7, "ojtdate", "发标日期"),
        REALDATE(8, "realdate", "实际满标日期"), 
        PRCP(9, "prcp", "应还款总本金"),
        INTST(10, "intst", "应还款总利息 "), 
        LASTREPAY(11, "lastrepay", "最后还款日期"),
        REALCLOSEDATE(12, "realclosedate", "实际结清日期"), 
        
        TOTALPRCP(13, "totalprcp", "至结清日累计还款本金"),
        TOTALINTST(14, "totalintst", "至结清日累计还款利息"), 
        REPAYPRCP(15, "repayprcp", "本日还款本金"),
        REPAYINTST(16, "repayintst", "本日还款利息"), 
        TOTALREPAYPRCP(17, "totalrepayprcp", "截止当日累计还款本金"),
        TATALREPAYINTST(18, "tatalrepayintst", "截止当日累计还款利息"), 
        ADVMONEY(19, "advmoney", "已垫资总金额 "),
        OUTADVMONEY(20, "outadvmoney", "剩余未偿垫资 "), 
        CREDITMONEY(21, "creditmoney", "当日放款金额"),
        TOTALCREDITMONEY(22, "totalcreditmoney", "截止当日累计放款");
        private int coordinate;
        private String field;
        private String comments;

        private UploadCoordinate(int coordinate, String field, String comments) {
            this.coordinate = coordinate;
            this.field = field;
            this.comments = comments;
        }
        
        public static Map<Integer, String> getCommentsCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                map.put(uploadCoordinate.getCoordinate(), uploadCoordinate.getComments());
            }
            return map;
        }

        public static Map<Integer, String> getTextCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                map.put(uploadCoordinate.getCoordinate(), uploadCoordinate.getField());
            }
            return map;
        }
        
        public static String getCommentsByCoordinate(int coordinate) {
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                if (uploadCoordinate.getCoordinate() == coordinate) {
                    return uploadCoordinate.comments;
                }
            }
            return null;
        }

        public int getCoordinate() {
            return coordinate;
        }

        public void setCoordinate(int coordinate) {
            this.coordinate = coordinate;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getComments() {
            return comments;
        }

        public void setComments(String comments) {
            this.comments = comments;
        }

    }

    
    /**
     * 
     * @Description 下载文本数据项坐标
     * @author zyt
     * @date 2016年05月03日
     *
     */
    public enum DownloadCoordinate {
    	PROID(0, "proid", "支付机构标的ID"), 
    	//MERCUSTID(1, "mercustid", "支付机构平台ID"),
    	/*BORRNAME(2, "borrname", "借款人姓名"), 
        BORRCERTTYPE(3, "borrcerttype", "借款人证件类型"),
        BORRCERTID(4, "borrcertid", "借款人证件号码"),*/ 
        
        CREDITACCTNO(1, "creditacctno", "放款客户号"),
        
        PROSTAT(5, "prostat", "标的状态"), 
        OJTDATE(6, "ojtdate", "发标日期"),
        REALDATE(7, "realdate", "实际满标日期"), 
        PRCP(8, "prcp", "应还款总本金"),
        INTST(9, "intst", "应还款总利息 "), 
        LASTREPAY(10, "lastrepay", "最后还款日期"),
        REALCLOSEDATE(11, "realclosedate", "实际结清日期"), 
        
        TOTALPRCP(12, "totalprcp", "至结清日累计还款本金"),
        TOTALINTST(13, "totalintst", "至结清日累计还款利息"), 
        REPAYPRCP(14, "repayprcp", "本日还款本金"),
        REPAYINTST(15, "repayintst", "本日还款利息"), 
        TOTALREPAYPRCP(16, "totalrepayprcp", "截止当日累计还款本金"),
        TATALREPAYINTST(17, "tatalrepayintst", "截止当日累计还款利息"), 
        ADVMONEY(18, "advmoney", "已垫资总金额 "),
        OUTADVMONEY(19, "outadvmoney", "剩余未偿垫资 "), 
        CREDITMONEY(20, "creditmoney", "当日放款金额"),
        TOTALCREDITMONEY(21, "totalcreditmoney", "截止当日累计放款"),
        CREDITFLAG(22, "creditflag", "放款审核状态"),
        FROZENMONEY(24, "frozenmoney", "冻结资金");
        private int coordinate;
        private String field;
        private String comments;

        private DownloadCoordinate(int coordinate, String field, String comments) {
            this.coordinate = coordinate;
            this.field = field;
            this.comments = comments;
        }
        
        public static Map<Integer, String> getCommentsCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                map.put(downloadCoordinate.getCoordinate(), downloadCoordinate.getComments());
            }
            return map;
        }

        public static Map<Integer, String> getTextCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                map.put(downloadCoordinate.getCoordinate(), downloadCoordinate.getField());
            }
            return map;
        }
        
        public static String getCommentsByCoordinate(int coordinate) {
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                if (downloadCoordinate.getCoordinate() == coordinate) {
                    return downloadCoordinate.comments;
                }
            }
            return null;
        }

        public int getCoordinate() {
            return coordinate;
        }

        public void setCoordinate(int coordinate) {
            this.coordinate = coordinate;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getComments() {
            return comments;
        }

        public void setComments(String comments) {
            this.comments = comments;
        }

    }
    
	private static final long serialVersionUID = 1L;

	/** 
	 * id
	 */
	private Long id;

	/** 
	 * 乐观锁版本号
	 */
	private Long version;

	/** 
	 * 客户id
	 */
	private String custid;

	/** 
	 * 国付宝交易时间
	 */
	private String gopayTxnTm;

	/** 
	 * 国付宝订单号
	 */
	private String orderid;

	private String natdate;

	private String nattime;

	private String filename;

	private String paymentid;

	/** 
	 * 支付机构标的ID
	 */
	private String proid;

	/** 
	 * 支付机构平台ID
	 */
	private String mercustid;

	/** 
	 * 放款客户号
	 */
	private String creditacctno;

	/** 
	 * 标的状态
	 */
	private String prostat;

	/** 
	 * 发标日期
	 */
	private String ojtdate;

	/** 
	 * 实际满标日期
	 */
	private String realdate;

	/** 
	 * 应还款总本金
	 */
	private BigDecimal prcp;

	/** 
	 * 应还款总利息
	 */
	private BigDecimal intst;

	/** 
	 * 最后还款日期
	 */
	private String lastrepay;

	/** 
	 * 实际结清日期
	 */
	private String realclosedate;

	private BigDecimal totalprcp;

	/** 
	 * 至结清日累计还款利息
	 */
	private BigDecimal totalintst;

	/** 
	 * 本日还款本金
	 */
	private BigDecimal repayprcp;

	/** 
	 * 本日还款利息
	 */
	private BigDecimal repayintst;

	/** 
	 * 截止当日累计还款本金
	 */
	private BigDecimal totalrepayprcp;

	/** 
	 * 截止当日累计还款利息
	 */
	private BigDecimal tatalrepayintst;

	/** 
	 * 已垫资总金额
	 */
	private BigDecimal advmoney;

	/** 
	 * 剩余未偿垫资
	 */
	private BigDecimal outadvmoney;

	/** 
	 * 当日放款金额
	 */
	private BigDecimal creditmoney;

	/** 
	 * 截止当日累计放款
	 */
	private BigDecimal totalcreditmoney;

	/** 
	 * CREDITFLAG
	 */
	private String creditflag;

	/** 
	 * FROZENMONEY
	 */
	private Long frozenmoney;

	private String frozenliqid;

	private String thawliqid;

	private String resv1;

	private String resv2;

	private String resv3;

	private String resv4;

	/**
	 * 借款人姓名
	 */
	private String borrname;

	/**
	 * 借款人证件号码
	 */
	private String borrcertid;

	/**
	 * 借款人证件类型
	 */
	private String borrcerttype;

	/**
	 * 失败原因
	 */
	private String commentRk;

	/** 
	 * 发送银行状态 已发送：01；未发送：02   ；发送失败：03 ； 发送中；04
	 */
	private String bankstate;

	/** 
	 * 创建时间
	 */
	private Date createdTs;

	/** 
	 * 记录最后修改时间
	 */
	private Date lastUpdTs;

	/**
	 * 备注
	 */
	private String remark;

	/**
	 * 备注
	 */
	private String remark2;

	/**
	 * 备注
	 */
	private String remark3;

	public GsrtBankHfTdAcctSum() {
	}

	public GsrtBankHfTdAcctSum(Long id, Long version, String custid, String gopayTxnTm, String orderid, String natdate,
							   String nattime, String filename, String paymentid, String proid, String mercustid,
							   String creditacctno, String prostat, String ojtdate, String realdate, BigDecimal prcp,
							   BigDecimal intst, String lastrepay, String realclosedate, BigDecimal totalprcp,
							   BigDecimal totalintst, BigDecimal repayprcp, BigDecimal repayintst,
							   BigDecimal totalrepayprcp, BigDecimal tatalrepayintst, BigDecimal advmoney,
							   BigDecimal outadvmoney, BigDecimal creditmoney, BigDecimal totalcreditmoney,
							   String creditflag, Long frozenmoney, String frozenliqid, String thawliqid,
							   String resv1, String resv2, String resv3, String resv4, String borrname,
							   String borrcertid, String borrcerttype, String commentRk, String bankstate,
							   Date createdTs, Date lastUpdTs, String remark, String remark2, String remark3) {
		this.id = id;
		this.version = version;
		this.custid = custid;
		this.gopayTxnTm = gopayTxnTm;
		this.orderid = orderid;
		this.natdate = natdate;
		this.nattime = nattime;
		this.filename = filename;
		this.paymentid = paymentid;
		this.proid = proid;
		this.mercustid = mercustid;
		this.creditacctno = creditacctno;
		this.prostat = prostat;
		this.ojtdate = ojtdate;
		this.realdate = realdate;
		this.prcp = prcp;
		this.intst = intst;
		this.lastrepay = lastrepay;
		this.realclosedate = realclosedate;
		this.totalprcp = totalprcp;
		this.totalintst = totalintst;
		this.repayprcp = repayprcp;
		this.repayintst = repayintst;
		this.totalrepayprcp = totalrepayprcp;
		this.tatalrepayintst = tatalrepayintst;
		this.advmoney = advmoney;
		this.outadvmoney = outadvmoney;
		this.creditmoney = creditmoney;
		this.totalcreditmoney = totalcreditmoney;
		this.creditflag = creditflag;
		this.frozenmoney = frozenmoney;
		this.frozenliqid = frozenliqid;
		this.thawliqid = thawliqid;
		this.resv1 = resv1;
		this.resv2 = resv2;
		this.resv3 = resv3;
		this.resv4 = resv4;
		this.borrname = borrname;
		this.borrcertid = borrcertid;
		this.borrcerttype = borrcerttype;
		this.commentRk = commentRk;
		this.bankstate = bankstate;
		this.createdTs = createdTs;
		this.lastUpdTs = lastUpdTs;
		this.remark = remark;
		this.remark2 = remark2;
		this.remark3 = remark3;
	}

	@Id
	@SequenceGenerator(name = "GsrtBankHfTdAcctSumSequence", sequenceName = "GSRT_BANK_HF_TD_ACCT_SUM_SEQ")
	@GeneratedValue(generator = "GsrtBankHfTdAcctSumSequence", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "VERSION", precision = 22, scale = 0)
	public Long getVersion() {
		return this.version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

	@Column(name = "CUSTID", length = 10)
	public String getCustid() {
		return this.custid;
	}

	public void setCustid(String custid) {
		this.custid = custid;
	}

	@Column(name = "GOPAY_TXN_TM", length = 8)
	public String getGopayTxnTm() {
		return this.gopayTxnTm;
	}

	public void setGopayTxnTm(String gopayTxnTm) {
		this.gopayTxnTm = gopayTxnTm;
	}

	@Column(name = "ORDERID", nullable = false, length = 32)
	public String getOrderid() {
		return this.orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	@Column(name = "NATDATE", nullable = false, length = 8)
	public String getNatdate() {
		return this.natdate;
	}

	public void setNatdate(String natdate) {
		this.natdate = natdate;
	}

	@Column(name = "NATTIME", nullable = false, length = 6)
	public String getNattime() {
		return this.nattime;
	}

	public void setNattime(String nattime) {
		this.nattime = nattime;
	}

	@Column(name = "FILENAME", length = 20)
	public String getFilename() {
		return this.filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	@Column(name = "PAYMENTID", nullable = false, length = 32)
	public String getPaymentid() {
		return this.paymentid;
	}

	public void setPaymentid(String paymentid) {
		this.paymentid = paymentid;
	}

	@Column(name = "PROID", nullable = false, length = 20)
	public String getProid() {
		return this.proid;
	}

	public void setProid(String proid) {
		this.proid = proid;
	}

	@Column(name = "MERCUSTID", nullable = false, length = 20)
	public String getMercustid() {
		return this.mercustid;
	}

	public void setMercustid(String mercustid) {
		this.mercustid = mercustid;
	}

	@Column(name = "CREDITACCTNO", length = 20)
	public String getCreditacctno() {
		return this.creditacctno;
	}

	public void setCreditacctno(String creditacctno) {
		this.creditacctno = creditacctno;
	}

	@Column(name = "PROSTAT", length = 1)
	public String getProstat() {
		return this.prostat;
	}

	public void setProstat(String prostat) {
		this.prostat = prostat;
	}

	@Column(name = "OJTDATE", length = 8)
	public String getOjtdate() {
		return this.ojtdate;
	}

	public void setOjtdate(String ojtdate) {
		this.ojtdate = ojtdate;
	}

	@Column(name = "REALDATE", length = 8)
	public String getRealdate() {
		return this.realdate;
	}

	public void setRealdate(String realdate) {
		this.realdate = realdate;
	}

	@Column(name = "PRCP", precision = 16)
	public BigDecimal getPrcp() {
		return this.prcp;
	}

	public void setPrcp(BigDecimal prcp) {
		this.prcp = prcp;
	}

	@Column(name = "INTST", precision = 16)
	public BigDecimal getIntst() {
		return this.intst;
	}

	public void setIntst(BigDecimal intst) {
		this.intst = intst;
	}

	@Column(name = "LASTREPAY", length = 8)
	public String getLastrepay() {
		return this.lastrepay;
	}

	public void setLastrepay(String lastrepay) {
		this.lastrepay = lastrepay;
	}

	@Column(name = "REALCLOSEDATE", length = 8)
	public String getRealclosedate() {
		return this.realclosedate;
	}

	public void setRealclosedate(String realclosedate) {
		this.realclosedate = realclosedate;
	}

	@Column(name = "TOTALPRCP", precision = 16)
	public BigDecimal getTotalprcp() {
		return this.totalprcp;
	}

	public void setTotalprcp(BigDecimal totalprcp) {
		this.totalprcp = totalprcp;
	}

	@Column(name = "TOTALINTST", precision = 16)
	public BigDecimal getTotalintst() {
		return this.totalintst;
	}

	public void setTotalintst(BigDecimal totalintst) {
		this.totalintst = totalintst;
	}

	@Column(name = "REPAYPRCP", precision = 16)
	public BigDecimal getRepayprcp() {
		return this.repayprcp;
	}

	public void setRepayprcp(BigDecimal repayprcp) {
		this.repayprcp = repayprcp;
	}

	@Column(name = "REPAYINTST", precision = 16)
	public BigDecimal getRepayintst() {
		return this.repayintst;
	}

	public void setRepayintst(BigDecimal repayintst) {
		this.repayintst = repayintst;
	}

	@Column(name = "TOTALREPAYPRCP", precision = 16)
	public BigDecimal getTotalrepayprcp() {
		return this.totalrepayprcp;
	}

	public void setTotalrepayprcp(BigDecimal totalrepayprcp) {
		this.totalrepayprcp = totalrepayprcp;
	}

	@Column(name = "TATALREPAYINTST", precision = 16)
	public BigDecimal getTatalrepayintst() {
		return this.tatalrepayintst;
	}

	public void setTatalrepayintst(BigDecimal tatalrepayintst) {
		this.tatalrepayintst = tatalrepayintst;
	}

	@Column(name = "ADVMONEY", precision = 16)
	public BigDecimal getAdvmoney() {
		return this.advmoney;
	}

	public void setAdvmoney(BigDecimal advmoney) {
		this.advmoney = advmoney;
	}

	@Column(name = "OUTADVMONEY", precision = 16)
	public BigDecimal getOutadvmoney() {
		return this.outadvmoney;
	}

	public void setOutadvmoney(BigDecimal outadvmoney) {
		this.outadvmoney = outadvmoney;
	}

	@Column(name = "CREDITMONEY", precision = 16)
	public BigDecimal getCreditmoney() {
		return this.creditmoney;
	}

	public void setCreditmoney(BigDecimal creditmoney) {
		this.creditmoney = creditmoney;
	}

	@Column(name = "TOTALCREDITMONEY", precision = 16)
	public BigDecimal getTotalcreditmoney() {
		return this.totalcreditmoney;
	}

	public void setTotalcreditmoney(BigDecimal totalcreditmoney) {
		this.totalcreditmoney = totalcreditmoney;
	}

	@Column(name = "CREDITFLAG", length = 1)
	public String getCreditflag() {
		return this.creditflag;
	}

	public void setCreditflag(String creditflag) {
		this.creditflag = creditflag;
	}

	@Column(name = "FROZENMONEY", precision = 16)
	public Long getFrozenmoney() {
		return this.frozenmoney;
	}

	public void setFrozenmoney(Long frozenmoney) {
		this.frozenmoney = frozenmoney;
	}

	@Column(name = "FROZENLIQID", length = 32)
	public String getFrozenliqid() {
		return this.frozenliqid;
	}

	public void setFrozenliqid(String frozenliqid) {
		this.frozenliqid = frozenliqid;
	}

	@Column(name = "THAWLIQID", length = 32)
	public String getThawliqid() {
		return this.thawliqid;
	}

	public void setThawliqid(String thawliqid) {
		this.thawliqid = thawliqid;
	}

	@Column(name = "RESV1", length = 30)
	public String getResv1() {
		return this.resv1;
	}

	public void setResv1(String resv1) {
		this.resv1 = resv1;
	}

	@Column(name = "RESV2", length = 30)
	public String getResv2() {
		return this.resv2;
	}

	public void setResv2(String resv2) {
		this.resv2 = resv2;
	}

	@Column(name = "RESV3", length = 60)
	public String getResv3() {
		return this.resv3;
	}

	public void setResv3(String resv3) {
		this.resv3 = resv3;
	}

	@Column(name = "RESV4", length = 60)
	public String getResv4() {
		return this.resv4;
	}

	public void setResv4(String resv4) {
		this.resv4 = resv4;
	}

	@Column(name = "BORRNAME", length = 150)
	public String getBorrname() {
		return this.borrname;
	}

	public void setBorrname(String borrname) {
		this.borrname = borrname;
	}

	@Column(name = "BORRCERTID", length = 20)
	public String getBorrcertid() {
		return this.borrcertid;
	}

	public void setBorrcertid(String borrcertid) {
		this.borrcertid = borrcertid;
	}

	@Column(name = "BORRCERTTYPE", length = 10)
	public String getBorrcerttype() {
		return this.borrcerttype;
	}

	public void setBorrcerttype(String borrcerttype) {
		this.borrcerttype = borrcerttype;
	}

	@Column(name = "COMMENT_RK", length = 50)
	public String getCommentRk() {
		return this.commentRk;
	}

	public void setCommentRk(String commentRk) {
		this.commentRk = commentRk;
	}

	@Column(name = "BANKSTATE", length = 2)
	public String getBankstate() {
		return this.bankstate;
	}

	public void setBankstate(String bankstate) {
		this.bankstate = bankstate;
	}

	@Column(name = "CREATED_TS", nullable = false)
	public Date getCreatedTs() {
		return this.createdTs;
	}

	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	@Column(name = "LAST_UPD_TS", nullable = false)
	public Date getLastUpdTs() {
		return this.lastUpdTs;
	}

	public void setLastUpdTs(Date lastUpdTs) {
		this.lastUpdTs = lastUpdTs;
	}

	@Column(name = "REMARK", length = 50)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "REMARK2", length = 50)
	public String getRemark2() {
		return this.remark2;
	}

	public void setRemark2(String remark2) {
		this.remark2 = remark2;
	}

	@Column(name = "REMARK3", length = 50)
	public String getRemark3() {
		return this.remark3;
	}

	public void setRemark3(String remark3) {
		this.remark3 = remark3;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
	}
}
